package com.xbk.seckill.reservation.application.builder;

import cn.hutool.core.bean.BeanUtil;
import com.xbk.seckill.common.builder.SeckillCommonBuilder;
import com.xbk.seckill.reservation.application.command.SeckillReservationConfigCommand;
import com.xbk.seckill.reservation.domain.model.entity.SeckillReservationConfig;

/**
 * @author xiexu
 * @date 2025/4/23 00:40
 */
public class SeckillReservationConfigBuilder extends SeckillCommonBuilder {

    public static SeckillReservationConfig toSeckillReservationConfig(SeckillReservationConfigCommand seckillReservationConfigCommand) {
        if (seckillReservationConfigCommand == null || seckillReservationConfigCommand.isEmpty()) {
            return null;
        }
        SeckillReservationConfig seckillReservationConfig = new SeckillReservationConfig();
        BeanUtil.copyProperties(seckillReservationConfigCommand, seckillReservationConfig);
        return seckillReservationConfig;
    }

}
